package domain.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Scorecard entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "scorecard", catalog = "bms")
public class Scorecard implements java.io.Serializable {

	// Fields

	private Integer id;
	private String commentsCommitmentChange;
	private String commentsDateChange;
	private Integer countryCommitment;
	private Date countryLpfv;
	private Date countryPlannedFpfv;
	private Integer globalCommitment;
	private Date globalPlannedFpfv;
    private Compromisopais compromisopais;
    private boolean state;

	private Set<Protocolscorecard> protocolscorecards = new HashSet<Protocolscorecard>(
			0);
	private Set<ProtocoloCompromisopais> protocoloCompromisopaises = new HashSet<ProtocoloCompromisopais>(
			0);

	// Constructors

	/** default constructor */
	public Scorecard() {
	}

	/** full constructor */
	public Scorecard(String commentsCommitmentChange,
			String commentsDateChange, Integer countryCommitment,
			Date countryLpfv, Date countryPlannedFpfv,
			Integer globalCommitment, Date globalPlannedFpfv,
			Set<Protocolscorecard> protocolscorecards,
			Set<ProtocoloCompromisopais> protocoloCompromisopaises) {
		this.commentsCommitmentChange = commentsCommitmentChange;
		this.commentsDateChange = commentsDateChange;
		this.countryCommitment = countryCommitment;
		this.countryLpfv = countryLpfv;
		this.countryPlannedFpfv = countryPlannedFpfv;
		this.globalCommitment = globalCommitment;
		this.globalPlannedFpfv = globalPlannedFpfv;
		this.protocolscorecards = protocolscorecards;
		this.protocoloCompromisopaises = protocoloCompromisopaises;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "commentsCommitmentChange")
	public String getCommentsCommitmentChange() {
		return this.commentsCommitmentChange;
	}

	public void setCommentsCommitmentChange(String commentsCommitmentChange) {
		this.commentsCommitmentChange = commentsCommitmentChange;
	}

	@Column(name = "commentsDateChange")
	public String getCommentsDateChange() {
		return this.commentsDateChange;
	}

	public void setCommentsDateChange(String commentsDateChange) {
		this.commentsDateChange = commentsDateChange;
	}

	@Column(name = "countryCommitment")
	public Integer getCountryCommitment() {
		return this.countryCommitment;
	}

	public void setCountryCommitment(Integer countryCommitment) {
		this.countryCommitment = countryCommitment;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "countryLPFV", length = 10)
	public Date getCountryLpfv() {
		return this.countryLpfv;
	}

	public void setCountryLpfv(Date countryLpfv) {
		this.countryLpfv = countryLpfv;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "countryPlannedFPFV", length = 10)
	public Date getCountryPlannedFpfv() {
		return this.countryPlannedFpfv;
	}

	public void setCountryPlannedFpfv(Date countryPlannedFpfv) {
		this.countryPlannedFpfv = countryPlannedFpfv;
	}

	@Column(name = "globalCommitment")
	public Integer getGlobalCommitment() {
		return this.globalCommitment;
	}

	public void setGlobalCommitment(Integer globalCommitment) {
		this.globalCommitment = globalCommitment;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "globalPlannedFPFV", length = 10)
	public Date getGlobalPlannedFpfv() {
		return this.globalPlannedFpfv;
	}

	public void setGlobalPlannedFpfv(Date globalPlannedFpfv) {
		this.globalPlannedFpfv = globalPlannedFpfv;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "scorecard")
	public Set<Protocolscorecard> getProtocolscorecards() {
		return this.protocolscorecards;
	}

	public void setProtocolscorecards(Set<Protocolscorecard> protocolscorecards) {
		this.protocolscorecards = protocolscorecards;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "scorecard")
	public Set<ProtocoloCompromisopais> getProtocoloCompromisopaises() {
		return this.protocoloCompromisopaises;
	}

	public void setProtocoloCompromisopaises(
			Set<ProtocoloCompromisopais> protocoloCompromisopaises) {
		this.protocoloCompromisopaises = protocoloCompromisopaises;
	}



    @OneToOne
    public Compromisopais getCompromisopais() {
        return compromisopais;
    }

    public void setCompromisopais(Compromisopais compromisopais) {
        this.compromisopais = compromisopais;
    }
    @Column(name = "state")
    public boolean getState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }
}